﻿<view:OnlineObjectView x:Class="Reader.View.BookPageView"
                xmlns:common="clr-namespace:System.Windows;assembly=System.Windows.Controls" 
                xmlns:view="clr-namespace:Reader.View"
                    xmlns:it="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls"
                xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                    xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" 
                    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
                    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" 
                    xmlns:samplesCommon="clr-namespace:OnlineBookReader;assembly=OnlineBookReader"
                    xmlns:loacl="clr-namespace:Reader.Domain"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
    Loaded="UserControl_Loaded"  FontSize="14">
    <StackPanel>
        <TextBlock x:Name="bookName"   FontSize="18" TextWrapping="Wrap" Text="{Binding BookName}"  HorizontalAlignment="Center"  />
        <Button Content="保存图书" Height="23" Name="saveBook" Width="75" Click="saveBook_Click" IsEnabled="False" />
        <Button Content="加入书架" Height="23" Name="AddFavorite" Width="75" Click="AddFavorite_Click" IsEnabled="False" />

        <HyperlinkButton  x:Name="content" FontSize="16" CommandParameter="{Binding BookContentUri}" Content="" Click="content_Click"  HorizontalAlignment="Center" VerticalAlignment="Center"  />
        
        <Grid HorizontalAlignment="Left" >

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
			 <RowDefinition Height="Auto"/>
			 <RowDefinition Height="Auto"/>
			  <RowDefinition Height="Auto"/>
			   <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <TextBlock   TextWrapping="Wrap" Text="最新章节：" VerticalAlignment="Center" HorizontalAlignment="Left"/>
    		<HyperlinkButton x:Name="lastChapter" CommandParameter="{Binding NewChapter.Uri}"  Content="{Binding NewChapter.Name}" Click="lastChapter_Click"  Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"  />
    		<TextBlock  Grid.Column="2" TextWrapping="Wrap" Text="更新时间：" VerticalAlignment="Center" HorizontalAlignment="Left"/>
			<TextBlock x:Name="lastChapterData" TextWrapping="Wrap" Text="{Binding LastUpdateTime}" Grid.Column="3" HorizontalAlignment="Left"  VerticalAlignment="Center" />

            <TextBlock   TextWrapping="Wrap" Text="Vip最新章节：" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" />
            <TextBlock x:Name="vipLastChapter"  Text="{Binding VipNewChapter.Name}"  Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" />
            <TextBlock Grid.Row="1"  Grid.Column="2" TextWrapping="Wrap" Text="更新时间：" VerticalAlignment="Center" HorizontalAlignment="Left"/>
            <TextBlock Grid.Row="1" x:Name="vipLastChapterData" TextWrapping="Wrap" Text="{Binding VipLastUpdateTime}" Grid.Column="3" HorizontalAlignment="Left"  VerticalAlignment="Center" />

            <TextBlock  Grid.Row="2" TextWrapping="Wrap" Text="作者：" VerticalAlignment="Center" HorizontalAlignment="Left"/>
			<TextBlock  x:Name="author" TextWrapping="Wrap" Text="{Binding Author}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.ColumnSpan="3"/>
    	
        <it:AnimatedImage Stretch="None"   Name="bookImage" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.ColumnSpan="4" LoadingFailed="Img_LoadingFailed" />
    		 <TextBlock x:Name="introduce"  TextWrapping="Wrap" Text="{Binding Introduce}" Grid.Row="4" Grid.ColumnSpan="4" />
       
    </Grid>
        
    </StackPanel>
</view:OnlineObjectView>
